Templates

Modified on 2011/04/04 14:05 by Charles — Categorized as: Jetfire Language

Templates

The templating feature of Jetfire supports the dynamic creation of code. This feature is significantly more advanced and easier to use than C# generics or C++ templates.

Jetfire templating is totally generic. It can be used to generate Jetfire code or any other text based source code (eg HTML, JavaScript, C#, etc).


Template Method Rules


Template Example

                namespace JetfireApps
                {
                 public workflow MyFlow
                 {
                    ArrayList list = new ArrayList();
                    public MyFlow()
                    {
                       list.Add(""One"");
                       list.Add(""Two"");
                       list.Add(""Three"");
                    }
                    public string TemplateTest()
                    {
                        ## the first line
                        foreach (string s in list)
                        {
                            ## $s$
                        }
                        return value;
                    } 
                 }
The 'Template' method 'TemplateTest()' when executed will return a string with the following value:
 the first line
 One
 Two
 Three

See Also

First Class Constructs
Jetfire Overview